Skip to content

ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag - #22835

Draft
Lms24 wants to merge 1 commit into
feat/before-send-span-streamed-defaultfrom
feat/span-streaming-tree-shaking
Draft

ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag #22835
Lms24 wants to merge 1 commit into
feat/before-send-span-streamed-defaultfrom
feat/span-streaming-tree-shaking

Conversation

@Lms24

@Lms24 Lms24 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Guards the automatic spanStreamingIntegration push behind __SENTRY_TRACING__ so that bundlers and CDN builds which compile tracing out can actually drop the integration. This should remove ~2KB of gzipped dead code for anyone who doesn't care about tracing.

TODO: Add a size check for a __SENTRY_TRACING__: false build

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.96 kB +0.17% +49 B 🔺
@sentry/browser - with treeshaking flags 28.14 kB +0.1% +27 B 🔺
@sentry/browser (incl. Tracing) 47.39 kB +0.08% +37 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.42 kB +0.14% +65 B 🔺
@sentry/browser (incl. Tracing, Profiling) 52.18 kB +0.1% +50 B 🔺
@sentry/browser (incl. Tracing, Replay) 86.74 kB +0.06% +48 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.17 kB +0.06% +45 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 91.47 kB +0.07% +58 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 104.14 kB +0.09% +91 B 🔺
@sentry/browser (incl. Feedback) 47.26 kB +0.1% +43 B 🔺
@sentry/browser (incl. sendFeedback) 34.79 kB +0.11% +37 B 🔺
@sentry/browser (incl. FeedbackAsync) 39.9 kB +0.1% +36 B 🔺
@sentry/browser (incl. Metrics) 31.04 kB +0.16% +49 B 🔺
@sentry/browser (incl. Logs) 31.27 kB +0.16% +47 B 🔺
@sentry/browser (incl. Metrics & Logs) 31.94 kB +0.15% +47 B 🔺
@sentry/react 31.77 kB +0.14% +44 B 🔺
@sentry/react (incl. Tracing) 49.67 kB +0.14% +65 B 🔺
@sentry/vue 35.04 kB +0.2% +68 B 🔺
@sentry/vue (incl. Tracing) 49.4 kB +0.12% +56 B 🔺
@sentry/svelte 29.99 kB +0.19% +55 B 🔺
CDN Bundle 32.01 kB +0.04% +10 B 🔺
CDN Bundle (incl. Tracing) 47.73 kB +0.03% +13 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.56 kB +0.03% +7 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.09 kB +0.04% +17 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.9 kB +0.01% +7 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.36 kB +0.02% +10 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.65 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.16 kB +0.03% +20 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.46 kB +0.02% +11 B 🔺
CDN Bundle - uncompressed 95.44 kB -0.06% -54 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 143.05 kB -0.02% -27 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.15 kB -0.06% -54 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.03 kB -0.02% -27 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.91 kB -0.03% -54 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.31 kB -0.02% -27 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.27 kB -0.02% -27 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.01 kB -0.01% -27 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.97 kB -0.01% -27 B 🔽
@sentry/nextjs (client) 52.24 kB +0.09% +42 B 🔺
@sentry/sveltekit (client) 47.86 kB +0.14% +64 B 🔺
@sentry/core/server 80.08 kB +0.09% +70 B 🔺
@sentry/core/browser 52.01 kB +0.1% +47 B 🔺
@sentry/node 120.94 kB +0.05% +58 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.54 kB -0.85% -716 B 🔽
@sentry/aws-serverless 92.98 kB +0.07% +61 B 🔺
@sentry/cloudflare (withSentry) - minified 219.37 kB +0.02% +31 B 🔺
@sentry/cloudflare (withSentry) 540.44 kB +0.01% +3 B 🔺

View base workflow run

@Lms24 Lms24 changed the title ref(core): Tree-shake spanStreamingIntegration when tracing is disabled ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag Jul 29, 2026
@Lms24 Lms24 changed the title ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag Jul 29, 2026
@Lms24
Lms24 force-pushed the feat/span-streaming-tree-shaking branch from 962dbc1 to 7de446c Compare July 29, 2026 15:37
@Lms24
Lms24 force-pushed the feat/span-streaming-tree-shaking branch from 7de446c to 74a1167 Compare August 3, 2026 12:58
…bled

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the feat/span-streaming-tree-shaking branch from 74a1167 to ee4761d Compare August 3, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant